home *** CD-ROM | disk | FTP | other *** search
/ HAKERIS 11 / HAKERIS 11.ISO / soft / development / Macromedia RoboHelp X5 / RoboHelpOffice.exe / Data1.cab / _B5C9073B3205468B8332D94C882D88CD < prev    next >
Encoding:
Text File  |  2003-07-28  |  8.0 KB  |  329 lines

  1. <html>
  2. <head>
  3. <title>navigation pane</title>
  4. <!--% WH_PROJECT_METATAGS %-->
  5. <script language="javascript" src="<!--%SF_VERSION_JS%-->"></script>
  6. <script language="javascript1.2" src="<!--%SF_MESSAGE_JS%-->"></script>
  7. <script language="javascript1.2" src="<!--%SF_PROXY_JS%-->"></script>
  8. <script language="javascript1.2" src="<!--%SF_UTILS_JS%-->"></script>
  9. <script language="javascript1.2">
  10. <!--
  11. var gsInitPane="toc";
  12. var gsCurrentPane="";
  13. var gbLoading = "unknown";
  14. var gbTryTime = 0;
  15. var gbMaxTryTime = 6;
  16. var gbPassPhase0 = 0;
  17. var gbretried = 0;
  18. var gbmaxretry = 3;
  19. var gbretrytime = new Array();
  20.  
  21. var origWidth = 0;
  22. var origHeight = 0;
  23.  
  24. gbretrytime[0]= 5000;
  25. gbretrytime[1]= 30000;
  26. gbretrytime[2]= 60000;
  27.  
  28. function addPane(sName, sFile)
  29. {
  30. }
  31.  
  32. function setShowPane(sName)
  33. {
  34.     gsInitPane=sName;
  35. }
  36.  
  37. <!--%   OutputNavPaneConfigBlock.htm("  addPane(\"%s\",\"%s\");\r\n|  setShowPane(\"%s\");\r\n"); %-->
  38.  
  39. function window_unload()
  40. {
  41.     UnRegisterListener2(this, WH_MSG_SHOWTOC);
  42.     UnRegisterListener2(this, WH_MSG_SHOWIDX);
  43.     UnRegisterListener2(this, WH_MSG_SHOWFTS);
  44.     UnRegisterListener2(this, WH_MSG_SHOWGLO);
  45.     UnRegisterListener2(this, WH_MSG_SYNCTOC);
  46.     UnRegisterListener2(this, WH_MSG_SEARCHTHIS);
  47.     UnRegisterListener2(this, WH_MSG_GETPANEINFO);
  48. }
  49.  
  50. function window_OnLoad()
  51. {
  52.     var bHidePane=false;
  53.     var oMsg=new whMessage(WH_MSG_GETCMD,this,1,null);
  54.     if (SendMessage(oMsg))
  55.     {
  56.         if(oMsg.oParam>0)
  57.         {
  58.             if(oMsg.oParam==1)
  59.                 gsInitPane="toc";
  60.             else if(oMsg.oParam==2)
  61.                 gsInitPane="idx";
  62.             else if(oMsg.oParam==3)
  63.                 gsInitPane="fts";
  64.             else if(oMsg.oParam==4)
  65.                 gsInitPane="glo";
  66.         }
  67.         else if(oMsg.oParam==0)
  68.         {
  69.             bHidePane=true;
  70.         }
  71.     }
  72.     if (bHidePane)
  73.     {
  74.         oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null)
  75.         SendMessage(oMsg);
  76.     }
  77.     else if (gsInitPane == "toc")
  78.     {
  79.         oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null)
  80.         SendMessage(oMsg);    
  81.     }
  82.     else if (gsInitPane=="idx")
  83.     {
  84.         oMsg=new whMessage(WH_MSG_SHOWIDX,this,1,null)
  85.         SendMessage(oMsg);    
  86.     }
  87.     else if (gsInitPane=="fts")
  88.     {
  89.         oMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null)
  90.         SendMessage(oMsg);    
  91.     }
  92.     else if (gsInitPane=="glo")
  93.     {
  94.         oMsg=new whMessage(WH_MSG_SHOWGLO,this,1,null)
  95.         SendMessage(oMsg);    
  96.     }
  97. }
  98.  
  99. function CheckLoadingPhase0()
  100. {
  101.     if (!gbPassPhase0) {
  102.         setTimeout("CheckLoadingPhase0()", 1000);
  103.         document.applets[0];
  104.         gbPassPhase0 = 1;
  105.     }
  106.     else {
  107.         CheckLoadingPhase1();
  108.     }
  109. }
  110.  
  111. function CheckLoadingPhase1()
  112. {
  113.     if (gbNav4) {
  114.         if ("unknown" == gbLoading && document.readystate < 4) {
  115.             setTimeout("CheckLoadingPhase1()", 1000);
  116.         }
  117.         else if ("unknown" == gbLoading) {
  118.             CheckLoadingPhase2();
  119.         }
  120.     }
  121. }
  122.  
  123. function CheckLoadingPhase2()
  124. {
  125.     if (gbNav4) {
  126.         gbTryTime ++;
  127.         if ("unknown" == gbLoading) {
  128.             if (gbTryTime <= gbMaxTryTime )
  129.                 setTimeout("CheckLoadingPhase2()", 1000);
  130.             else {
  131.                 if (gnVerMinor != 4.60) {
  132.                     alert("%%% WH_CUR_LNG.JS_alert_appletNotLoad %%%");
  133.                 }
  134.             }    
  135.         }
  136.     }
  137. }
  138.  
  139. function CheckAppletLoaded()
  140. {
  141.     if (typeof(document.webhelp) == "undefined")
  142.     {
  143.         document.location.reload();
  144.         if (gbretried < gbmaxretry)
  145.         {
  146.             gbretried ++;
  147.             setTimeout("CheckAppletLoaded();", gbretrytime[gbretried]);
  148.         }
  149.     }
  150. }
  151.  
  152. function reDo() 
  153. {
  154.     if (innerWidth != origWidth || innerHeight != origHeight)  
  155.     {
  156.         //reloaded applet if nessary
  157.         gbretried = 0;
  158.  
  159.         if (gnVerMinor == 4.60) 
  160.         {
  161.             //reload the applet again.
  162.             document.location.reload();
  163.             gbretried ++;
  164.         }
  165.         setTimeout("CheckAppletLoaded();", gbretrytime[gbretried]);
  166.     }
  167. }
  168.  
  169. function onSendMessage(oMsg)
  170. {
  171.     if (oMsg)
  172.     {    
  173.         var nMsgId = oMsg.nMessageId;
  174.         var WebHelpApplet = null;
  175.         if (gbNav4)
  176.         {
  177.             WebHelpApplet = document.applets["WebHelp"];
  178.             if (!WebHelpApplet.Command)
  179.                 document.location="%%% WH_WEBSKIN.navpane.list %%%";
  180.         }
  181.         else
  182.             WebHelpApplet = WebHelp;
  183.  
  184.         if(nMsgId==WH_MSG_GETPANEINFO)
  185.         {
  186.             oMsg.oParam=gsCurrentPane;
  187.             return false;
  188.         }
  189.         else if (gbLoading!="unknown"||gbNav6)
  190.         {
  191.             if (nMsgId == WH_MSG_SHOWTOC)
  192.             {
  193.                 gsCurrentPane="toc";
  194.                 WebHelpApplet .Command("Contents", null);
  195.                 var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "toc");
  196.                 SendMessage(onMsg);
  197.                 onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  198.                 SendMessage(onMsg);
  199.             }
  200.             else if (nMsgId == WH_MSG_SHOWIDX)
  201.             {
  202.                 gsCurrentPane="idx";
  203.                 WebHelpApplet .Command("Index", null);
  204.                 var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "idx");
  205.                 SendMessage(onMsg);
  206.                 onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  207.                 SendMessage(onMsg);
  208.             }
  209.             else if (nMsgId == WH_MSG_SHOWFTS)
  210.             {
  211.                 gsCurrentPane="fts";
  212.                 WebHelpApplet .Command("Search", null);
  213.                 var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "fts");
  214.                 SendMessage(onMsg);
  215.                 onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  216.                 SendMessage(onMsg);
  217.             }
  218.             else if (nMsgId == WH_MSG_SHOWGLO)
  219.             {
  220.                 gsCurrentPane="glo";
  221.                 WebHelpApplet .Command("Glossary", null);
  222.                 var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "glo");
  223.                 SendMessage(onMsg);
  224.                 onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  225.                 SendMessage(onMsg);
  226.             }
  227.             else if (nMsgId == WH_MSG_SYNCTOC)
  228.             {
  229.                 gsCurrentPane="toc";
  230.                 var oTopicParam = oMsg.oParam;
  231.                 if (oTopicParam && oTopicParam.aPaths && oTopicParam.aPaths.length > 0 && oTopicParam.sPPath)
  232.                 {
  233.                     var sPPath = _browserStringToText(oTopicParam.sPPath);
  234.                     var sParam = "";
  235.                     for (var i = 0; i < oTopicParam.aPaths.length; i ++)
  236.                     {
  237.                         sParam += oTopicParam.aPaths[i] + "\r\r";
  238.                     }
  239.                     WebHelpApplet.Command("SyncToc", sPPath,  sParam);
  240.                 }
  241.             }
  242.             else if(nMsgId==WH_MSG_SEARCHTHIS)
  243.             {
  244.                 gsCurrentPane="fts";
  245.                 WebHelpApplet .Command("Search", oMsg.oParam);
  246.                 var onMsg=new whMessage(WH_MSG_PANEINFO, this, 1, "fts");
  247.                 SendMessage(onMsg);
  248.                 onMsg = new whMessage(WH_MSG_SHOWPANE, this, 1, null);
  249.                 SendMessage(onMsg);
  250.             }
  251.         }
  252.     }
  253.     return true;
  254. }
  255.  
  256. function getInitTocInfo()
  257. {
  258.     // send message ask for the first time sync toc info.
  259.     var oParam = new Object();
  260.     oParam.oTocInfo = null;
  261.     var oMsg = new whMessage(WH_MSG_GETTOCPATHS, this, 1, oParam);
  262.     if (SendMessage(oMsg ))
  263.     {
  264.         var oTopicParam = oMsg.oParam.oTocInfo;
  265.         if (oTopicParam && oTopicParam.aPaths && oTopicParam.aPaths.length > 0 && oTopicParam.sPPath)
  266.         {
  267.             var sPPath = _browserStringToText(oTopicParam.sPPath);
  268.             var sParam = "";
  269.             for (var i = 0; i < oTopicParam.aPaths.length; i ++)
  270.             {
  271.                 sParam += oTopicParam.aPaths[i] + "\r\r";
  272.             }
  273.             var WebHelpApplet;
  274.             if (gbNav4)
  275.                 WebHelpApplet = document.applets["WebHelp"];
  276.             else
  277.                 WebHelpApplet = WebHelp;
  278.             WebHelpApplet.Command("SyncToc", sPPath,  sParam);
  279.         }
  280.     }
  281. }
  282.  
  283. if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy)
  284. {
  285.     RegisterListener2(this, WH_MSG_SHOWTOC);
  286.     RegisterListener2(this, WH_MSG_SHOWIDX);
  287.     RegisterListener2(this, WH_MSG_SHOWFTS);
  288.     RegisterListener2(this, WH_MSG_SHOWGLO);
  289.     RegisterListener2(this, WH_MSG_SYNCTOC);
  290.     RegisterListener2(this, WH_MSG_SEARCHTHIS);
  291.     RegisterListener2(this, WH_MSG_GETPANEINFO);
  292.  
  293.     window.onunload = window_unload;
  294.     window.onload=window_OnLoad;
  295.     window.onerror = null;
  296.     var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));
  297.  
  298.     if (gbNav4 && !gbNav6 && gbWindows) {
  299.         setTimeout("CheckLoadingPhase0()", 1000);
  300.     }
  301.  
  302.     if (gbNav4) 
  303.     {
  304.         origWidth = innerWidth;
  305.         origHeight = innerHeight;
  306.         onresize = reDo;
  307.     }
  308. }
  309. else
  310.     document.location.reload();
  311.  
  312. if (window.gbNav6)
  313. {
  314.     var oMsg=new whMessage(WH_MSG_RELOADNS6,this, 1,null);
  315.     SendMessage(oMsg);
  316. }
  317.  
  318. //-->
  319. </script>
  320. </head>
  321. <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor="c0c0c0">
  322. <applet code=WebHelp.class name=WebHelp  archive=%%%SF_APPLET_CODE_JAR%%% width=100% height=100% MAYSCRIPT hspace=0 vspace=0>
  323. <PARAM name=ProjectFile value=%%%SF_PROJECT_XML%%%><PARAM name=ResourceFile value=%%%SF_APPLET_RES_XML%%%>
  324. <PARAM name=Frame value=bsscright>
  325. <PARAM name=cabbase value=%%%SF_APPLET_CODE_CAB%%%>
  326. </applet>
  327. </body>
  328. </html>
  329.